package xdj.android.personal.namespace.Views;

import xdj.android.personal.R;
import xdj.android.personal.namespace.Business.LineDBAccess;
import xdj.android.personal.namespace.Entity.LineEntity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import android.widget.TextView;

public class XdjAndroidLineActivity extends
		MyListActivity<LineEntity, LineDBAccess>
{
	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		super.SetBusiness(new LineDBAccess(this));
		super.setTitle(getResources().getString(R.string.LineViewTitle));

	}

	@Override
	protected void onListItemClick(ListView l, View v, int position, long id)
	{
		// TODO Auto-generated method stub
		super.onListItemClick(l, v, position, id);
		TextView txtLineid = (TextView) v
				.findViewById(R.id.lineItemViewTxtLineId);
		String lineidString = txtLineid.getText().toString();
		TextView txtLineName = (TextView) v
				.findViewById(R.id.lineItemViewTxtLineName);
		String lineNameString = txtLineName.getText().toString();
		Intent intent = new Intent(this, IdposListActivity.class);
		intent.putExtra("LineId", lineidString);
		intent.putExtra("LineName", lineNameString);
		startActivity(intent);
	}

}
